
$(function() {
	
	var columns = [{
	    id: "#",
	    name: "",
	    width: 40,
	    behavior: "selectAndMove",
	    unselectable: true,
	    resizable: false,
	    cssClass: "cell-reorder"
	}, {
	    id: "no",
	    name: "序号",
	    field: "no",
	    width: 50,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "emp",
	    name: "工号",
	    field: "emp",
	    width: 60,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "name",
	    name: "姓名",
	    field: "name",
	    width: 60,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "social",
	    name: "社保编号",
	    field: "social",
	    width: 100,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "a",
	    name: "养老基数",
	    field: "a",
	    width: 80,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "a1",
	    name: "养老(个)",
	    field: "a1",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "a2",
	    name: "养老(公)",
	    field: "a2",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "b",
	    name: "医疗基数",
	    field: "b1",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "b1",
	    name: "医疗(个)",
	    field: "b1",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "b2",
	    name: "医疗(公)",
	    field: "b2",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "c",
	    name: "工伤基数",
	    field: "c",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "c2",
	    name: "工伤(公)",
	    field: "c2",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "d",
	    name: "失业基数",
	    field: "d",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "d1",
	    name: "失业(个)",
	    field: "d1",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "d2",
	    name: "失业(公)",
	    field: "d2",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "e",
	    name: "生育医疗基数",
	    field: "e",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "e2",
	    name: "生育医疗(公)",
	    field: "e2",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "idcard",
	    name: "身份证",
	    field: "idcard",
	    width: 200,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "content",
	    name: "备注",
	    field: "content",
	    width: 70,
	    cssClass: "cell-title",
	    editor: Slick.Editors.Text
	}, {
	    id: "ok",
	    name: "",
	    field: "ok",
	    width: 40,
	    cssClass: "cell-effort-driven",	    
	    cannotTriggerInsert: true,
	    formatter: Slick.Formatters.YesNo,
	    editor: Slick.Editors.Checkbox
	}];
	
	var options = {
			editable: true,
		    enableAddRow: false,
		    enableCellNavigation: true,
		    asyncEditorLoading: false,
		    rowHeight: 30
		};	
	
	// alert(data);
	
	var grid = new Slick.Grid($("#myGrid"), social_data, columns, options);
	
	grid.onCellChange.subscribe(function(e, args) {
		item = args.item;
		currentCell = args.cell;
		currentRow = args.row;
		
		grid.updateRowCount();
	    grid.render();
	});
	
	
});
